package com.xin.net
{
import flash.display.Loader;
import flash.events.Event;
import flash.system.ApplicationDomain;
import flash.system.LoaderContext;
public class SWFLoader extends LoaderBase
{
	private var _loader:Loader;
	
	public function SWFLoader(url:String)
	{
		super(url);
	}
	
	override protected function onComplete():void 
	{
		var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);
		
		_loader = new Loader();
		_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete_loader);
		_loader.loadBytes(getByteArray(), loaderContext);
	}
	
	private function complete_loader(e:Event):void
	{
		_loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, complete_loader);
		dispatchEvent(new Event(Event.COMPLETE));
	}
}
}